<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 首先先定义一个构造函数
        function myClass(a, b) {
            console.log(this, 'this');
            this.a = a
            this.b = b
        }
        myClass.prototype.getValue = function () {
            return `a is ${this.a}, b is ${this.b}`
        }
        let useMyClass = new myClass(1, 2)
        useMyClass.getValue()
        console.log(useMyClass.getValue());
    </script>
</body>

</html>